import RequestUtils from '@/utils/RequestUtils'

export default {
	/**
	 * 新增
	 * @param params
	 * @returns {AxiosPromise}
	 */
	add(params = {}) {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
	pickUpPlan() {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan/genPickupPlan`,
			method: 'POST',
		})
	},
	/**
	 * 批量删除（多个用逗号隔开）
	 * @param ids
	 * @returns {AxiosPromise}
	 */
	remove(ids) {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan/${ids}`,
			method: 'DELETE'
		})
	},
	/**
	 * 修改
	 * @param params
	 * @returns {AxiosPromise}
	 */
	edit(params = {}) {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan`,
			method: 'PUT',
			data: {
				...params
			}
		})
	},
	/**
	 * 详情
	 * @param id
	 * @returns {AxiosPromise}
	 */
	get(id) {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan/${id}`,
			method: 'GET'
		})
	},
	/**
	 * 列表
	 * @param params
	 * @returns {AxiosPromise}
	 */
	list(params = {}) {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan/search`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
	/**
	 * 列表-分页
	 * @param params
	 * @returns {AxiosPromise}
	 */
	page(params = {}, page) {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan/search/${page.current}/${page.pageSize}`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
	pickPlan() {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan/genPickupPlan`,
			method: 'POST',
		})
	},
	handlePublish() {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan/handlePublish`,
			method: 'POST',
		})
	},

handleMove(params) {
		return RequestUtils({
			url: `/tms/tFoFreightOrderItem/moveDispatch`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
	handleFreight(params, ids) {
		return RequestUtils({
			url: `/tms/tFoFreightOrderItem/generateFreightOrderFromDelivery/${ids}`,
			method: 'POST',
			data: {
				...params
			}
		})
	},
	pickPlanBySelectItem(params, ids) {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan/genPickupPlanBySelectItem/${ids}`,
			method: 'POST',
		})
	},
	/**
	 * 导出
	 * @param params
	 * @returns {AxiosPromise}
	 */
	exportData(params = {}) {
		return RequestUtils({
			url: `/web/tWmsDeliveryPickupPlan/exportData`,
			method: 'POST',
			data: {
				...params
			}
		})
	}
}
